package com.friend.solr.config;

import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.CorsRegistry;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

/**
 * @program: yzh->WebMvcConfig
 * @description: WebMvcConfig
 * @author: yangzhanghui
 * @create: 2019-09-04 13:38
 **/
@Configuration
public class WebMvcConfig implements WebMvcConfigurer {

    @Override
    public void addCorsMappings(CorsRegistry registry){
        registry.addMapping("/**").allowedOrigins("*")
            .allowedMethods("*").allowedHeaders("*");
    }

    @Override
    public void addInterceptors(InterceptorRegistry registry) {
        //添加篮球界器，配置拦截器地址
//        registry.addInterceptor(new LoginIntercept()).addPathPatterns("/**");
    }
}